package chapter;

/**
 * 睡眠排序 睡眠时间间隔大才准确
 */
public class ArraySort implements Runnable{
    private String num;
    public ArraySort(int num){
        this.num=num+"";
    }
    @Override
    public void run() {
        try {
            Thread.sleep(Integer.parseInt(num)+10);
            System.out.println(num);
        }catch (Exception e){
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        int[] array = {11,3,998,5455,1,152,990};
        for(int i=0;i<array.length;i++){
            new Thread(new ArraySort(array[i])).start();
        }
    }
}
